package com.muqi.app.user.widget;


import com.muqi.app.qlearn.student.R;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.EditText;
import android.widget.RelativeLayout;
import android.widget.TextView;

public class RecordEdtEntry extends RelativeLayout {
	private TextView mTitle;
	private EditText mEdittext;
	
	public RecordEdtEntry(Context context, String title) {
		super(context);
		init(context);
		mTitle.setText(title);
	}

	public RecordEdtEntry(Context context, AttributeSet attrs) {
		super(context, attrs);
		init(context);
	}

	public RecordEdtEntry(Context context, AttributeSet attrs, int defStyleAttr) {
		super(context, attrs, defStyleAttr);
		init(context);
	}

	private void init(Context context) {
		LayoutInflater inflater = LayoutInflater.from(context);
		View view = inflater.inflate(R.layout.record_edttext_entry, this);
		mTitle = (TextView) view.findViewById(R.id.title);
		mEdittext = (EditText) view.findViewById(R.id.recordEditText);
	}

	public void setEditHint(String hints) {
		mEdittext.setHint(hints);
	}
	
	public void setEditSize(float size) {
		mEdittext.setTextSize(size);
	}

	public void setEditColor(int resId) {
		mEdittext.setTextColor(resId);
	}
	
	/**
	 * 
	 */
	public String getEditTextValue() {
		return mEdittext.getText().toString().trim();
	}
	
	/**
	 *  
	 * @return 返回对应的key
	 */
	public String getTextViewValue(){
		return mTitle.getText().toString().trim();
	}
}
